import count from '@feidao/web/atom/nodejs/db/count';
import query from '@feidao/web/atom/nodejs/db/query';
import { IBaseTable } from '@feidao/web/atom/nodejs/db/interfaces';
import operate from '@feidao/web/atom/nodejs/db/operate';
import { spaceid, systemid } from './config';

interface Message {
	filter: {};
	page_size: number;
	page_no: number;
	asc: string[];
	desc: string[];
}

function get_d(t: number) {
	if (t > 9) {
		return t + '';
	} else {
		return '0' + t;
	}
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	const d = new Date();
	const t = new Date(d.getTime() + 1 * 60 * 60 * 1000);
	const res = {
		fee: '0.01',
		des: 'test',
		time_start: d.getFullYear() + '' + get_d(d.getMonth() + 1) + d.getDate() + get_d(d.getHours()) + get_d(d.getMinutes()) + get_d(d.getSeconds()),
		time_expire: t.getFullYear() + '' + get_d(t.getMonth() + 1) + t.getDate() + get_d(t.getHours()) + get_d(t.getMinutes()) + get_d(t.getSeconds())
	};
	return res;
}
